package com.phenix.mvp.ui.login;

import com.phenix.annotation.apt.Instance;
import com.phenix.mvp.api.Api;
import com.phenix.mvp.base.helper.RxSchedulers;
import com.phenix.mvp.data.Result;
import com.phenix.mvp.data.bean.User;

import io.reactivex.Observable;

/**
 * @author  zhouphenix on 2017-2-21.
 */
@Instance
public class LoginModel implements LoginPresenter.Model {
    @Override
    public Observable<Result<User>> login(String name, String pass) {
        return Api.getInstance().service
                .login(name,pass)
                .compose(RxSchedulers.io2Omain());
    }

}